﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Modules.zoo.ui {
    import flash.events.*;
    import Events.*;
    import org.aswing.*;
    import Classes.*;
    import Classes.util.*;
    import Display.*;
    import Display.MarketUI.*;
    import Display.aswingui.*;

    public class ZooPlaceFromInventoryModule extends JPanel {

        private var m_win:JWindow;
        private var m_marketCell:MarketCellCustomText;
        private var m_itemDefinition:Item;

        public function ZooPlaceFromInventoryModule(_arg1:String){
            super(null);
            this.m_itemDefinition = Global.gameSettings.getItemByName(_arg1);
            this.m_marketCell = new MarketCellCustomText(ZLoc.t("Dialogs", "Place"));
            this.m_marketCell.setCellValue(this.m_itemDefinition);
            this.m_marketCell.addEventListener(DataItemEvent.MARKET_BUY, this.onMarketCellClick, false, 0);
            var _local2:JPanel = ASwingHelper.makeSoftBoxJPanelVertical();
            _local2.append(this.m_marketCell);
            append(_local2);
            addEventListener(MarketEvent.MARKET_BUY, UI.onMarketClick, false, 0, true);
        }
        private function onMarketCellClick(_arg1:DataItemEvent):void{
            var _local3:MarketEvent;
            Sounds.playFromSet(Sounds.SET_CLICK);
            var _local2:Item = (_arg1.item) ? _arg1.item : null;
            if (_local2){
                _local3 = new MarketEvent(MarketEvent.MARKET_BUY, MarketEvent.GENERIC, _local2.name);
                _local3.eventSource = MarketEvent.SOURCE_INVENTORY;
                dispatchEvent(_local3);
            };
            dispatchEvent(new Event(Event.CLOSE));
        }

    }
}//package Modules.zoo.ui 
